package com.nginx.web.util;

import cn.hutool.core.util.RandomUtil;

public class VersionUtil {

    public static String getNewVersion(){
        return "1.0.0";
    }

    public static String getNextVersion(String version){
        String[] split = version.split("\\.");
        Integer a = Integer.parseInt(split[0]);
        Integer b = Integer.parseInt(split[1]);
        Integer c = Integer.parseInt(split[2]);
        Integer num = a * 100 + b * 10 + c;
        num += 1;
        Integer a1 = num % 100;
        Integer a2 = (num - a1 ) / 100;
        Integer c1 = a1 % 10;
        Integer b1 = (a1 - c1) / 10;
        return a2 + "." + b1 + "." + c1;
    }

    public static String getRuleUUID(){
        String uuid = "RL" + RandomUtil.randomString(6) + RandomUtil.randomNumbers(6);
        return uuid ;
    }

    public static String getRuleCollUUID(){
        String uuid = "RC" + RandomUtil.randomString(6) + RandomUtil.randomNumbers(6);
        return uuid ;
    }
}
